<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/WEB-INF/pages/admin/public/meta.jsp"></jsp:include>
<title>区域图</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 统计管理 <span class="c-gray en">&gt;</span> 区域图 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	
	<div id="container" style="min-width:700px;height:600px"></div>
</div>
<!--_footer 作为公共模版分离出去-->
<jsp:include page="/WEB-INF/pages/admin/public/footer.jsp"></jsp:include>
 <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="admin/lib/hcharts/Highcharts/5.0.6/js/highcharts.js"></script>
<script type="text/javascript" src="admin/lib/hcharts/Highcharts/5.0.6/js/modules/exporting.js"></script>
<script type="text/javascript" src="admin/lib/echarts/3.4.0/echarts.min.js"></script>
<script type="text/javascript">
showCharts();
function showCharts() {  
	 var myChart = echarts.init(document.getElementById('container'));
	 option = {
			    title : {
			        text: '交易分析',
			        subtext: '根据商品分类对比',
			        x:'center'
			    },
			    tooltip : {
			        trigger: 'item',
			        formatter: "{a} <br/>{b} : {c} ({d}%)"
			    },
			    legend: {
			        orient: 'vertical',
			        left: 'left',
			        data: ['财税服务','公司工商','知识产权','社保代理']
			    },
			    series : [
			        {
			            name: '分类统计',
			            type: 'pie',
			            radius : '55%',
			            center: ['50%', '60%'],
			            data:[
			                {value:(function() {
	                            var count = [];
	                            $.ajax({
	                                        async : false, //这句必须加
	                                        method : 'post',
	                                        url : 'countProductOne.action',
	                                        dataType : "json",
	                                        success : function(data) {
													count.push(data);						
	                                        },
	                            			error:function(){
	                            				alert('失败');
	                            			}
	                                    });
	                         
	                            return count;
	                        })(), name:'财税服务'}, 
			                {value:(function() {
	                            var count = [];
	                            $.ajax({
	                                        async : false, //这句必须加
	                                        method : 'post',
	                                        url : 'countProductTwo.action',
	                                        dataType : "json",
	                                        success : function(data) {
													count.push(data);
	                                        },
	                            			error:function(){
	                            				alert('失败');
	                            			}
	                                    });
	                         
	                            return count;
	                        })(), name:'公司工商'},
			                {value:(function() {
	                            var count = [];
	                            $.ajax({
	                                        async : false, //这句必须加
	                                        method : 'post',
	                                        url : 'countProductThree.action',
	                                        dataType : "json",
	                                        success : function(data) {          	
													count.push(data);											
	                                        },
	                            			error:function(){
	                            				alert('失败');
	                            			}
	                                    });
	                            return count;
	                        })(), name:'知识产权'},
			                {value:(function() {
	                            var count = [];
	                            $.ajax({
	                                        async : false, //这句必须加
	                                        method : 'post',
	                                        url : 'countProductFour.action',
	                                        dataType : "json",
	                                        success : function(data) {
													count.push(data);
	                                        },
	                            			error:function(){
	                            				alert('失败');
	                            			}
	                                    });
	                         
	                            return count;
	                        })(), name:'社保代理'}
			            ],
			            itemStyle: {
			                emphasis: {
			                    shadowBlur: 10,
			                    shadowOffsetX: 0,
			                    shadowColor: 'rgba(0, 0, 0, 0.5)'
			                }
			            }
			        }
			    ]
			};
	 	// 使用刚指定的配置项和数据显示图表。
	 	myChart.setOption(option); 
// 	 	window.onresize = myChart.resize;
}
</script>
</body>
</html>